﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Business.Models;
using Business.ProductCuringManagement;
using Business.ProductCuringManagement.Dto;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Domain.Repositories;
using static Business.Permissions.BusinessPermissions;

namespace Business.Controllers
{
    [RemoteService]
    [Area("Business")]
    [Route("api/business/productCuring")]
    public class ProductCuringController : AbpController
    {
        private readonly IProductCuringAppService _productCuringAppService;
        public ProductCuringController(IProductCuringAppService productCuringAppService)
        {
            _productCuringAppService = productCuringAppService;
        }

        /// <summary>
        /// 新增产品养护
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("curing-post")]
        public Task<ProductCuringDto> CreateOrUpdate(ProductCuringDto input)
        {
            return _productCuringAppService.CreateOrUpdate(input);
        }

        /// <summary>
        /// 删除产品养护
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        [HttpDelete]
        [Route("delete-curing-type")]
        public Task DeleteProductCuring(List<Guid> id)
        {
            return _productCuringAppService.DeleteProductCuring(id);
        }

        /// <summary>
        /// 获取产品养护详情
        /// </summary>
        /// <param name = "id" ></ param >
        /// < returns ></ returns >
        [HttpGet]
        [Route("find-curing-type")]
        public  Task<ProductCuringDto> GetProductCuringForEdit(Guid id)
        {
            return _productCuringAppService.GetProductCuringForEdit(id);
        }


        /// <summary>
        /// 获取产品养护列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("get-curing-list")]
        public  Task<PagedResultDto<ProductCuringDto>> GetProductCuringList(ProductCuringInputDto input)
        {
            return _productCuringAppService.GetProductCuringList(input);
        }

    }
}
